package service;

import java.util.List;

import dao.UploadDAO;
import vo.Upload;

public class UploadService {
	
	private UploadDAO uploadDAO=new UploadDAO();
	
	public List<Upload> findAll() {
		return uploadDAO.findAll();
	}

	public void save(Upload upload) {
		uploadDAO.save(upload);
		
	}

	public void delete(Integer id) {
		uploadDAO.delete(id);
		
	}

	public String getFileSaveName(Integer id) {
		String result=null;
		Upload upload = uploadDAO.findById(id);
		if(upload!=null){
			result=upload.getUuid()+".tmp";
		}
		return result;
	}

	public String getFilename(Integer id) {
		String result=null;
		Upload upload = uploadDAO.findById(id);
		if(upload!=null){
			result=upload.getFilename();
		}
		return result;
	}

}
